package com.ruoyi.message.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.message.mapper.IotBroadcastMessageMapper;
import com.ruoyi.message.domain.IotBroadcastMessage;
import com.ruoyi.message.service.IIotBroadcastMessageService;

/**
 * 广播消息通知Service业务层处理
 * 
 * @author wujiale
 * @date 2025-04-26
 */
@Service
public class IotBroadcastMessageServiceImpl implements IIotBroadcastMessageService 
{
    @Autowired
    private IotBroadcastMessageMapper iotBroadcastMessageMapper;

    /**
     * 查询广播消息通知
     * 
     * @param messageId 广播消息通知主键
     * @return 广播消息通知
     */
    @Override
    public IotBroadcastMessage selectIotBroadcastMessageByMessageId(Long messageId)
    {
        return iotBroadcastMessageMapper.selectIotBroadcastMessageByMessageId(messageId);
    }

    /**
     * 查询广播消息通知列表
     * 
     * @param iotBroadcastMessage 广播消息通知
     * @return 广播消息通知
     */
    @Override
    public List<IotBroadcastMessage> selectIotBroadcastMessageList(IotBroadcastMessage iotBroadcastMessage)
    {
        return iotBroadcastMessageMapper.selectIotBroadcastMessageList(iotBroadcastMessage);
    }

    /**
     * 新增广播消息通知
     * 
     * @param iotBroadcastMessage 广播消息通知
     * @return 结果
     */
    @Override
    public int insertIotBroadcastMessage(IotBroadcastMessage iotBroadcastMessage)
    {
        iotBroadcastMessage.setCreateTime(DateUtils.getNowDate());
        return iotBroadcastMessageMapper.insertIotBroadcastMessage(iotBroadcastMessage);
    }

    /**
     * 修改广播消息通知
     * 
     * @param iotBroadcastMessage 广播消息通知
     * @return 结果
     */
    @Override
    public int updateIotBroadcastMessage(IotBroadcastMessage iotBroadcastMessage)
    {
        iotBroadcastMessage.setUpdateTime(DateUtils.getNowDate());
        return iotBroadcastMessageMapper.updateIotBroadcastMessage(iotBroadcastMessage);
    }

    /**
     * 批量删除广播消息通知
     * 
     * @param messageIds 需要删除的广播消息通知主键
     * @return 结果
     */
    @Override
    public int deleteIotBroadcastMessageByMessageIds(Long[] messageIds)
    {
        return iotBroadcastMessageMapper.deleteIotBroadcastMessageByMessageIds(messageIds);
    }

    /**
     * 删除广播消息通知信息
     * 
     * @param messageId 广播消息通知主键
     * @return 结果
     */
    @Override
    public int deleteIotBroadcastMessageByMessageId(Long messageId)
    {
        return iotBroadcastMessageMapper.deleteIotBroadcastMessageByMessageId(messageId);
    }
}
